<template>
  <div id="app">
    <!-- vue有一个内置组件transition -->
    <transition name="fade" mode="out-in">
      <router-view class="router-link" :tabBarRef="$refs.tabBar"></router-view>
    </transition>
    <tab-bar ref="tabBar" />
    <!-- 登录注册的popup窗体 -->
    <mt-popup v-model="isLoginRegist" position="bottom" class="login-regist" ref="loginRegistPopup">
      <login-regist :popup="$refs.loginRegistPopup" />
    </mt-popup>
  </div>
</template>

<script>
import "./index.less";
import { middleVue } from "../../services";
export default {
  data() {
    return {
      isLoginRegist: false
    };
  },
  mounted() {
    middleVue.$on("openLoginRegist", isOpen => {
      this.isLoginRegist = isOpen;
    });
  },
  destoryed() {
    middleVue.$off("openLoginRegist");
  }
};
</script>
